

import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@WebServlet("/reject")
public class reject extends HttpServlet {
	private static final long serialVersionUID = 1L;
    public reject() throws ClassNotFoundException {
        super();
        Class.forName ("org.sqlite.JDBC");
    }
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		try {
			Connection conn = DriverManager.getConnection("jdbc:sqlite:cms.db");
			String name=request.getParameter("roll");
			PreparedStatement preStatement1=null;
		   	preStatement1 = conn.prepareStatement("update fee set req=\'0\' where roll= ?");
		   	preStatement1.setString(1, name);
		   	preStatement1.executeUpdate();
		   	response.getWriter().println("Request for installemnt from "+name+"is rejected");
		   	preStatement1.close();
		    conn.close();
		} catch (SQLException e) {
			e.printStackTrace();
		}

	}
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
	}

}
